package com.explore.demo.service;

import com.explore.demo.common.ServerResponse;
import com.explore.demo.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author gaolainan
 * @since 2021-04-14
 */
public interface UserService extends IService<User> {
    /**
     * 注册新的用户
     * @param account 账户
     * @param password 密码
     * @return 返回成功 或者 失败
     */
    public ServerResponse register(String account, String password, HttpServletRequest request);

    /**
     * 用户登录
     * @param account 账户
     * @param password 密码
     * @param request
     * @return 返回登录的user
     */
    public ServerResponse login(String account,String password, HttpServletRequest request);

    /**
     * 通过账号或者验证码登录
     * @param account
     * @param verifyCode
     * @param request
     * @return
     */
    public ServerResponse loginByVerifyCode(String account, String verifyCode, HttpServletRequest request);

    /**
     * 注销登录
     * @param request
     * @return 返回注销成功与否
     */
    public ServerResponse logout(HttpServletRequest request);

    /**
     * 获得所有的用户列表
     * @param request
     * @return 返回成功或者失败
     */
    public ServerResponse queryAllUsers(HttpServletRequest request);


    /**
     * 通过用户的账号查询用户的信息
     * @param account 账号
     * @param request
     * @return 返回user信息
     */
    public ServerResponse queryUserByAccount(String account, HttpServletRequest request);

    /**
     * 更新用户的信息
     * @param user 用户的信息
     * @param request
     * @return 返回修改成功或者失败
     */
    public ServerResponse updateUser(User user, HttpServletRequest request);

    /**
     * 删除用户的信息
     * @param account 账号
     * @param request
     * @return 返回删除 或者 失败
     */
    public ServerResponse deleteUser(String account, HttpServletRequest request);

    /**
     * 向输入的手机号发送手机验证码
     * @param account 发送的手机号
     * @param request
     * @return 返回发送成功与否
     */
    public ServerResponse generateVerifyCode(String account, HttpServletRequest request);

    /**
     * 获得当前用户的收藏的职位的简略信息
     * @param request
     * @return
     */
    public ServerResponse getStarRecruitment(HttpServletRequest request);

    /**
     * 用户可以收藏自己感兴趣的职位
     * @param request
     * @param recruitmentId
     * @return
     */
    public ServerResponse setStarRecruitment(HttpServletRequest request, Integer recruitmentId);

    /**
     * 更改用户自己的头像
     * @param request
     * @param file
     * @return
     */
    public ServerResponse changeHeadPortrait(MultipartFile file, HttpServletRequest request);

    /**
     * 创建一个新的简历
     * @param awardInfo
     * @param internship
     * @param personSummary
     * @param request
     * @return
     */
    public ServerResponse createResume(String awardInfo, String internship, String personSummary, HttpServletRequest request);

    /**
     * 查看自己创建的简历的信息
     * @param request
     * @return
     */
    public ServerResponse showOwnResume(HttpServletRequest request);


    /**
     * 返回当前用户的投递记录
     * @param request
     * @return
     */
    public ServerResponse showOwnDeliveryLog(HttpServletRequest request);

}
